#!/usr/bin/env python
# -*- coding: utf-8 -*-

from odoo import models, fields

class QualityRejectReason(models.Model):
    _name = 'quality.reject.reason'
    _description = 'Quality Reject Reasons'

    check_id = fields.Many2one('quality.check', required=True)
    product_id = fields.Many2one('product.template', 'Product ID', related="check_id.product_id.product_tmpl_id")
    categ_id = fields.Many2one('product.category', 'Category ID', related="check_id.product_id.product_tmpl_id.categ_id")
    quantity = fields.Float('Rejected Qty')
    reject_reason = fields.Many2one('product.iqc.reject.reason.line', 'Reason', required=True)
    description = fields.Char('Description')
